package cn.iocoder.yudao.module.xkfz.controller.admin.clinicalHealthCare;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.xkfz.domain.entity.clinicalHealthCare.ElementData;
import cn.iocoder.yudao.module.xkfz.domain.po.clinicalHealthCare.ElementDataPo;
import cn.iocoder.yudao.module.xkfz.service.basic.IndicatorClassCalculationService;
import cn.iocoder.yudao.module.xkfz.service.clinicalHealthCare.ClinicalHealthCareService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.util.List;

import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;

@RestController
@RequestMapping("clinicalHealthCare")
public class ClinicalHealthCareController {


    @Autowired
    IndicatorClassCalculationService indicatorClassCalculationService;
    @Autowired
    ClinicalHealthCareService clinicalHealthCareService;;
    /**
     * 测试排序
     * @param elementDataPo
     * @return
     */
    @GetMapping("importClinicalHealthCare")
    public CommonResult<Boolean> importClinicalHealthCare(ElementDataPo elementDataPo){
        //查询指标的原始数据
        List<ElementData> elementData = indicatorClassCalculationService.queryElements(elementDataPo);
        return success(clinicalHealthCareService.importClinicalHealthCare(elementData, elementDataPo.getPeriodTime(), String.valueOf(elementDataPo.getId())));
    }
}
